package UIComponents
{
	import MyComponent.MyButton;
	
	import UIComponents.Messages.PanelEvent;
	
	import fl.events.ComponentEvent;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	
	/** 
	 * @author thy
	 * @version 1.0.0 
	 * 创建时间：Jul 18, 2012 3:46:37 PM 
	 */ 
	public class NewWeaponWindown extends Sprite
	{
		private var centerBtn:MyButton;
		private var weaponIc:IconContainer;
		
		public function NewWeaponWindown()
		{
			init();
		}
		
		private function init():void
		{
			this.centerBtn=this.getChildByName("sureBtn") as MyButton;
			this.weaponIc=this.getChildByName("weaponIc") as IconContainer;
			this.centerBtn.addEventListener(ComponentEvent.BUTTON_DOWN,close);
		}
		
		private function close(e:ComponentEvent):void
		{
			this.dispatchEvent(new PanelEvent(PanelEvent.CLOSE,true));
		}
		
		public function setWeaponIc(ic:DisplayObject,tips:String=""):void
		{
			this.weaponIc.addPic(null);
			ic.width=106;
			ic.height=106;
			this.weaponIc.addPic(ic,tips);
		}
		
	}
}
